package com.ty.day3;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : txy
 * @Create 2023/10/30 14:11
 */
public class Five {
    public static void main(String[] args) {
        System.out.println(func(100));

    }

    private static long func(int i) {
        if (i > 1) {
            return i + func(i - 1);
        } else {
            return 1;
        }
    }
}
